package study2018.com.xtianzhuang.www.designPattern.SingleTonPattern;

public class SingleTonDemo2 {
	private static SingleTonDemo2 instance = null;
	static {
		instance = new SingleTonDemo2();
	}

	// 私有构造 防止创建对象
	private SingleTonDemo2() {

	}

	public synchronized static SingleTonDemo2 getInstance() {
		return instance;
	}
}
